'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE, NOW } = app.Sequelize;
  const Discuss = app.model.define(
    'discuss',
    {
      discussId: {
        type: INTEGER(10),
        primaryKey: true,
        autoIncrement: true,
      },
      topicId: { type: INTEGER },
      userId: { type: STRING(255) },
      replayContent: { type: STRING(255), allowNull: true },
      replayName: { type: STRING(255), allowNull: false },
      created_at: { type: DATE, defaultValue: NOW },
      updated_at: { type: DATE, defaultValue: NOW },
    },
    {
      freezeTableName: true,
    }
  );
  return Discuss;
};
